/// <summary>
/// Copyright 2010 Ivo Limmen (ivo@limmen.org)
///
/// Licensed under the Apache License, Version 2.0 (the "License");
/// you may not use this file except in compliance with the License.
/// You may obtain a copy of the License at
/// 
/// http://www.apache.org/licenses/LICENSE-2.0
/// 
/// Unless required by applicable law or agreed to in writing, software
/// distributed under the License is distributed on an "AS IS" BASIS,
/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
/// See the License for the specific language governing permissions and
/// limitations under the License.
/// </summary>

using System;
using Services.Logging.Api;
using Services.Configuration.Api;

namespace ServiceController.Api
{	
	public interface IService
	{
		string GetName();
		
		string GetDescription();
	
        /// <summary>
        /// Services that are required for this service to run correctly.
        /// </summary>
        /// <returns>An array of names of services</returns>
		string[] GetRequiredServices();
				
		/// <summary>
		/// This method is called before Initialize and after all services are registered.
		/// </summary>
		/// <param name="serviceManager">
		/// A <see cref="IServiceManager"/>
		/// </param>
		void SetServiceManager(IServiceManager serviceManager);

		void SetLogger(ILogger logger);

        void SetConfiguration(IResolver resolver);

		bool RequiresRemoting();

		/// <summary>
		/// Initialize the service, this call is done after the service is registered and all services
		/// are available.
		/// </summary>
		void Initialize();

        /// <summary>
        /// When the ServiceController is stopped this method is called on all services.
        /// </summary>
        void Stop();
    }
}
